package com.itboye.sunsunhome.www.aq;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;

import com.itboye.sunsunhome.www.aq.R;
import com.itboye.sunsunhome.www.aq.base.AppConfig;
import com.itboye.sunsunhome.www.aq.base.MyApplication;

public class StartActivity extends Activity {

	MyApplication mApp;

	@SuppressLint("NewApi") @Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// 隐藏系统虚拟按键
		getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
		// 显示启动界面
		setContentView(R.layout.activity_start);
		mApp = (MyApplication)getApplication();
		// 延迟进入设备界面
		new Handler().postDelayed(new Runnable() {
			public void run() {
				// 初始化处理
				mApp.init();
				// 界面切换
				Intent mainIntent = new Intent(StartActivity.this,
						DeviceActivity.class);
				StartActivity.this.startActivity(mainIntent);
				StartActivity.this.finish();
			}
		}, AppConfig.Display_Delay);
	}
}
